package uk.ac.nott.cs.g53dia;

/**
 * An abstract implementation of the Cell interface.
 *
 * @author Julian Zappalla
 */

/*
 * Copyright (c) 2009 Julian Zappala (jxz@cs.nott.ac.uk)
 * 
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

public abstract class DefaultCell implements Cell, Cloneable {
	
	private Point point;
	
	DefaultCell(Point point) {
		this.point = point;
	}
	
	public Point getPoint() {
		return this.point;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((point == null) ? 0 : point.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DefaultCell other = (DefaultCell) obj;
		if (point == null) {
			if (other.point != null)
				return false;
		} else if (!point.equals(other.point))
			return false;
		return true;
	}
	
    abstract public Object clone();
	
}
